package cz.semjob.learning.classifier;

import org.springframework.stereotype.Component;

import weka.classifiers.Classifier;
import weka.core.Instance;
import cz.semjob.learning.data.TaxonomyLearningException;

@Component
public class InstanceClassifierHelper {
	
	public double classifyInstance(Classifier classifier, Instance instance) throws TaxonomyLearningException {
		try {
			return classifier.classifyInstance(instance);
		} catch (Exception e) {
			e.printStackTrace();
			throw new TaxonomyLearningException(e);
		}
	}
}
